import cv2
import numpy as np

# 处理低通滤波的api

img = cv2.imread("C:\\Users\\86191\\Pictures\\Saved Pictures\\Camera Roll\\rw.jpg")
img1 = cv2.imread("C:\\Users\\86191\\Pictures\\Saved Pictures\\face\\fy.jpg")
# kernel = np.ones((5,5), np.float32) / 25
# dst = cv2.filter2D(img,-1,kernel)

# 均值滤波
# dst = cv2.blur(img,(3,3))

# 方盒滤波
# dst = cv2.boxFilter(img,-1,(5,5))

# 高斯滤波(处理高斯噪点)
# dst = cv2.GaussianBlur(img,(5,5),1)

# 中值滤波(处理胡椒噪点)
# dst = cv2.medianBlur(img,5)

# 双边滤波(美颜)
dst = cv2.bilateralFilter(img,9,100,150)
# cv2.imshow("img1", img1)
cv2.imshow("img", img)
cv2.imshow("dst", dst)
cv2.waitKey(0)